package cn.com.cifi.mars.web.action;

import cn.com.cifi.mars.common.base.BaseAction;
import cn.com.cifi.mars.common.bean.R;
import cn.com.cifi.mars.entity.common.IdmUser;
import cn.com.cifi.mars.service.DataRecoveryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: JingYuanXiang
 * @date: 2021/4/7 15:46
 */

@RestController
public class DataRecoveryController extends BaseAction implements IDataRecoveryController {
    @Autowired
    private DataRecoveryService dataRecoveryService;


    @Override
    public R dataRecoveryOne(String apiVersion) {
        IdmUser user = getOperator();
        dataRecoveryService.recoveryOne(user);
        return ok();
    }

    @Override
    public R dataRecoveryTwo(String apiVersion, List<String> idList) {
        IdmUser user = getOperator();
        dataRecoveryService.recoveryTwo(user,idList);
        return ok();
    }

    @Override
    public R dataRecoveryThree(String apiVersion, List<String> idList) {
        IdmUser user = getOperator();
        dataRecoveryService.recoveryThree(user,idList);
        return ok();
    }
}
